import Vue from 'vue'
import Vuex from 'vuex';
 
Vue.use(Vuex);
const store = new Vuex.Store({
  state: {
    LOADING: false,
    token:'123'
  },
  mutations: {
    showLoading(state){
        state.LOADING = true    
    },
    hideLoading (state) {
        state.LOADING = false
    },
    set_token(state, token) {
      state.token = token
      localStorage.token = token
    },
    del_token(state) {
      state.token = ''
      localStorage.removeItem('token')
    }
  }
})
export default store